<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表单提交结果</title>
</head>
<body>
<h2>表单提交结果</h2>
<div id="result">
    <p>用户名: <span id="username"></span></p>
    <p>密码: <span id="password"></span></p>
    <p>个人简介: <span id="bio"></span></p>
    <p>性别: <span id="gender"></span></p>
    <p>订阅新闻简报: <span id="newsletter"></span></p>
    <p>国家: <span id="country"></span></p>
</div>

<script>
    // 获取 URL 中的参数
    var urlParams = new URLSearchParams(window.location.search);

    // 显示表单数据
    document.getElementById("username").innerText = urlParams.get("username");
    document.getElementById("password").innerText = urlParams.get("password");
    document.getElementById("bio").innerText = urlParams.get("bio");
    document.getElementById("gender").innerText = urlParams.get("gender") === "male" ? "男性" : "女性";
    document.getElementById("newsletter").innerText = urlParams.get("newsletter") === "1" ? "是" : "否";
    document.getElementById("country").innerText = urlParams.get("country");
</script>
</body>
</html>
